package cate.game.role.res.call;

import cate.game.role.res.call.advance.CallAdvanceHandler;
import cate.game.role.res.call.base.ICallHandler;
import cate.game.role.res.call.nature.CallNatureExchangeHandler;
import easy.java.dev.note.NoteField;

import java.util.HashMap;
import java.util.Map;

public class CallManager {
    @NoteField(value = "英雄召唤通用基础")
    public static CallCommonBaseHandler commonHandler = new CallCommonBaseHandler();

    @NoteField(value = "高级召唤处理")
    public static CallAdvanceHandler advanceHandler = new CallAdvanceHandler();

    @NoteField(value = "食神召唤-置换")
    public static CallNatureExchangeHandler callNatureExchangeHandler = new CallNatureExchangeHandler();
    @NoteField(value = "食神召唤-基础许愿")
    public static CallNatureBaseHandler callNatureBaseHandler = new CallNatureBaseHandler();

    @NoteField(value = "")
    private static Map<Integer, ICallHandler> handlers = new HashMap<>();


    public static ICallHandler getHandler(int type) {
        return handlers.get(type);
    }

    public static void register(int type, ICallHandler handler) {
        handlers.put(type, handler);
    }

    public static void register(int type) {
        handlers.put(type, commonHandler);
    }

}
